import request from '@/utils/request'
export function getDepartment(id) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/GetDepartment',
    method: 'get',
    params: { id }
  })
}
export function getDepartmentTree(params) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/GetDepartmentTree',
    method: 'get',
    params
  })
}
export function getDepartmentPoses(params) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/getDepartmentPoses',
    method: 'get',
    params
  })
}
export function getDepartmentEmps(params) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/GetDepartmentEmps',
    method: 'get',
    params
  })
}
export function addDepartment(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/AddDepartment',
    method: 'post',
    data
  })
}
export function modifyDepartment(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/ModifyDepartment',
    method: 'post',
    data
  })
}
export function removeDepartment(dpmId) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/RemoveDepartment',
    method: 'get',
    params: { dpmId }
  })
}
export function addPosition(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/AddPosition',
    method: 'post',
    data
  })
}
export function modifyPosition(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/ModifyPosition',
    method: 'post',
    data
  })
}
export function deletePosition(posId) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/DeletePosition',
    method: 'get',
    params: {
      posId
    },
  })
}

export function removeDpmEmp(emp) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/RemoveDpmEmp',
    method: 'post',
    data: { DE_ID: emp.DE_ID }
  })
}

export function addPositionEmployee(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/AddPositionEmployee',
    method: 'post',
    data
  })
}

export function removePositionEmployee(peId) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/RemovePositionEmployee',
    method: 'get',
    params: { peId }
  })
}

export function addDepartmentEmployees(data) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/AddDepartmentEmployees',
    method: 'post',
    data
  })
}

export function deleteDepartmentEmployee(deId) {
  return request({
    url: '/api/Organiztion/CompanyDepartmentManage/DeleteDepartmentEmployee',
    method: 'get',
    params: { deId }
  })
}

